Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding custom changes to grammes fork #1

Closed
wants to merge 16 commits into from
Closed

Conversation

waleedakramkhan
Copy link

@waleedakramkhan
Copy link
Author

i've also added test for a custom StringStep functionality added by @MDanialSaleem please review

@waleedakramkhan waleedakramkhan marked this pull request as draft January 3, 2023 18:07
Copy link
Author

@waleedakramkhan waleedakramkhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our version is too old - even older than K6scope itself i believe (at least more than 4 years) i have reviewed and commented on what i believe how the two versions should be merged but i lack the context for these changes so im importing them and leaving them here for all stakeholders to decide unanimously around these. my opinions are in the comments.

my preference would be to not introduce so many changes because from what i have seen, original library provides all methods to attain the goals we are with our custom changes except for type ones (maybe those too but not able to comment confidently).


err = responseDetectError(resp.Code, message)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this file were removed here

should be put back imo

@@ -77,7 +77,6 @@ var (
{
"requestId": "d2476e5b-b2bc-6a70-2647-3991f68ab415",
"status": {
"message": "Some error",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this file were removed here

should be put back imo

@@ -26,15 +26,13 @@ import "strconv"
type NetworkError struct {
statusCode int
msg string
origMsg string
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this file were removed here

should be put back imo

manager/addvertex.go Show resolved Hide resolved
manager/misc.go Outdated
@@ -21,8 +21,6 @@
package manager

import (
"errors"
"fmt"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think this change will be accepted by maintainers of this repo

@@ -32,11 +38,42 @@ package traversal
// Property(interface{} (Object), interface{} (Object), ...interface{} (Object))
// Property(Cardinality, string (Object), interface{} (Object), ...interface{} (Object))
func (g String) Property(objOrCard interface{}, obj interface{}, params ...interface{}) String {
fullParams := make([]interface{}, 0, len(params)+2)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe that this change should be reverted..it's already handled by library in a much better design after refactoring..

query/traversal/graph.go Outdated Show resolved Hide resolved
@@ -0,0 +1,14 @@
package traversal

// StringStep adds a custom string to the traversal. This is not a gremlin step.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added by @MDanialSaleem will add tests for it

. "github.com/smartystreets/goconvey/convey"
)

func TestStringStep(t *testing.T) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests for functionality added by @MDanialSaleem

@@ -88,6 +88,10 @@ func (g *String) AddStep(step string, params ...interface{}) {
g.buffer.Write(t)
case string:
g.buffer.WriteString("\"" + strings.ReplaceAll(t, "\"", "\\\"") + "\"")
case int64, uint64:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved the change in refactored newer version here

@waleedakramkhan waleedakramkhan marked this pull request as ready for review January 4, 2023 13:32
Copy link
Collaborator

@kingzbauer kingzbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple of comments

manager/addvertex.go Show resolved Hide resolved
model/vertex_query.go Show resolved Hide resolved
edge1 := EdgeWithPropsAndLabel{
Label: "testLbl",
Id: tstoutVID,
Properties: []interface{}{"tstIntrf1", 7777, "tstIntrf2", 9876},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably include a set property with a value of type e.g []int or []string and []interface{} to make sure they are handled correctly.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Properties are a list of interface and we cannot send int as interface, can we?


if len(params) > 0 {
for _, p := range params {
switch p.(type) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we explicitly check for float as well?

WriteBufferSize: 1024 * 8, // Set up for large messages.
ReadBufferSize: 1024 * 8, // Set up for large messages.
WriteBufferSize: 1024 * 256, // Set up for large messages.
ReadBufferSize: 1024 * 256, // Set up for large messages.
Copy link

@MDanialSaleem MDanialSaleem Jan 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should make this configurable.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add another method that takes this as param as input? Otherwise we'll have to modify this signature which might not work for upstream.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for now, we can let it be. There needs to be a more detailed investigation into why we changed what we changed, and if there is a better way to make those changes, before we can merge this to upstream.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tried this but this needs more parameterizing than it looks so i reverted my changes. i think it's better to open up this issue on grammes and then see how it goes

go.uber.org/zap v1.9.1
)

replace github.com/northwesternmutual/grammes v1.2.0 => github.com/Kaleidoscope-Inc/grammes v1.2.1-0.20230221065140-059981b86c6f

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does this package attempts to refer to an older version of itself?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was an attempt to not change module everywhere since we want it to use our changes but it failed because go has problems with moving on from her ex - i decided to create a separate branch and use this in our code

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see that makes sense. That probably has to do with go's package mechanism + forking. Anyway, LGTM!

Copy link

@MDanialSaleem MDanialSaleem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one minor comment otherwise lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants